<?php
class CommentsController extends AppController {

	var $name = 'Comments';
	var $helpers = array('Html', 'Form');

	 // ADMIN
	function admin_index() {
		$paginate = array('Comment'=>array('order'=>'Comment.created DESC','limit'=>20,'recursive'=>0));
		$this->set('comments', $this->paginate('Comment'));
	}

	function admin_delete($id) {
		if (!$id) {
			$this->Session->setFlash(sprintf(__('Invalid id for %s.', true), __('Comment',false)));
			$this->redirect(array('action'=>'admin_index'));
		}
		if ($this->Comment->del($id)) {
			$this->Session->setFlash(sprintf(__('The %s has been deleted.', true),__('Comment',true)));
			$this->redirect(array('action'=>'admin_index'));
		}
	}

}
?>